<!DOCTYPE html>
<html>
<head>
    <include file="Include:meta"/>
    <title>按项目调整收入-目的地运营集团数据管理平台</title>
    <include file="Include:style"/>
    <style>
        .w50 {
            width: 50px;
        }
    </style>
</head>
<body>
<include file="Include:header"/>
<include file="Include:left"/>
<div id="main">
    <div class="crumbs">
        <div class="crumbs-text">收入月报表 > 按项目调整收入</div>
    </div>
    <div id="content">
        <form action="__APP__/Crm/income_change_by_pid" method="post" id="market_edit_form">
            <input name="pid", value="{$pid}" type="hidden">
            <table class="table table-bordered table-hover table-hover-contact">
				<tr class="table-header fixed-table-header">
					<td width="150" class="nowrap">项目名称</td>
					<td width="50" class="nowrap">年份</td>
					<td width="50" class="nowrap">1月</td>
					<td width="50" class="nowrap">2月</td>
					<td width="50" class="nowrap">3月</td>
					<td width="50" class="nowrap">4月</td>
					<td width="50" class="nowrap">5月</td>
					<td width="50" class="nowrap">6月</td>
					<td width="50" class="nowrap">7月</td>
					<td width="50" class="nowrap">8月</td>
					<td width="50" class="nowrap">9月</td>
					<td width="50" class="nowrap">10月</td>
					<td width="50" class="nowrap">11月</td>
					<td width="50" class="nowrap">12月</td>
					<td width="50" class="nowrap">KPI</td>
				</tr>
				<if condition="$result eq NULL">
				<tr>
					<td colspan="15" class="text-center">暂无相关内容</td>
				</tr>
				</if>
				<foreach name="result" item="vo">
					<tr>
						<if condition="($result_order[$vo['pid']]['imid'] eq $vo['imid'])">
						<td class="nowrap" style="vertical-align:middle" rowspan={$result_order[$vo['pid']]['count']}>{:getProjectInfoByIncome($vo['pid'])}</td>
						</if>
						<td>{$vo['year']}<input type="hidden" name="imid[]" value="{$vo['year']}_{$vo['imid']}"></td>
						<td><input type="text" name="{$vo['year']}_m1" value="<if condition="($vo['m1'] neq NULL)">{$vo['m1']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m2" value="<if condition="($vo['m2'] neq NULL)">{$vo['m2']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m3" value="<if condition="($vo['m3'] neq NULL)">{$vo['m3']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m4" value="<if condition="($vo['m4'] neq NULL)">{$vo['m4']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m5" value="<if condition="($vo['m5'] neq NULL)">{$vo['m5']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m6" value="<if condition="($vo['m6'] neq NULL)">{$vo['m6']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m7" value="<if condition="($vo['m7'] neq NULL)">{$vo['m7']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m8" value="<if condition="($vo['m8'] neq NULL)">{$vo['m8']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m9" value="<if condition="($vo['m9'] neq NULL)">{$vo['m9']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m10" value="<if condition="($vo['m10'] neq NULL)">{$vo['m10']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m11" value="<if condition="($vo['m11'] neq NULL)">{$vo['m11']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_m12" value="<if condition="($vo['m12'] neq NULL)">{$vo['m12']}</if>" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
						<td><input type="text" name="{$vo['year']}_kpi" value="{:getProjectKpiByIncome($vo['pid'],$vo['year'])}" class="form-control required-text all w100" autocomplete="off" onkeyup="num(this);"></td>
					</tr>
				</foreach>
			</table>
            <p class="red Text_c bili_item hide"></p>
            <div class="form-btn-item"><input type="submit" value="提交" class="btn btn-submit">
                <button class="btn btn-default goback" type="button">返回</button>
            </div>
        </form>
    </div>
</div>
</body>
<include file="Include:javascript"/>
<script type="text/javascript">
		function num(obj){
			obj.value = obj.value.replace(/[^\d.]/g,""); //清除"数字"和"."以外的字符
			obj.value = obj.value.replace(/^\./g,""); //验证第一个字符是数字
			obj.value = obj.value.replace(/\.{2,}/g,"."); //只保留第一个, 清除多余的
			obj.value = obj.value.replace(".","$#$").replace(/\./g,"").replace("$#$",".");
			obj.value = obj.value.replace(/^(\-)*(\d+)\.(\d\d).*$/,'$1$2.$3'); //只能输入两个小数
		}
</script>
</html>